t1 = (1, "Hello",True)
t2 = ()
t3 = tuple()
print(f"t1的类型是:{type(t1)},内容是：{t1}")
print(f"t2的类型是:{type(t2)},内容是：{t2}")
print(f"t3的类型是:{type(t3)},内容是：{t3}")
t4 = ("Hello",)#单个元素后需要加逗号，否则识别为str
print(f"t4的类型是:{type(t4)},内容是：{t4}")
# 嵌套元组
t5 = ((1, 2, 3), (4, 5, 6))
print(f"t5的类型是:{type(t5)},内容是：{t5}")
num = t5[1][2]
print(f"嵌套元组中取出的元素是:{num}")
#元组不可修改，但里面如果有列表元素则可以修改列表
t6 = (1, 3, ["abc","hello"])
print(f"t6的内容是：{t6}")
t6[2][0] = "xyz"
t6[2][1] = "goodbye"
print(f"修改后t6的内容是：{t6}")